<?php 
$sql = "select * from tttj.category where appid={$appid} order by id asc";
$query = exec_db($sql);
$goods_category = array();
while ($value = mysqli_fetch_assoc($query)) {
	$goods_category[] = $value;
}
$paramname = '$goods_category';
$content = '<?php ';
$content .= "$paramname = " . var_export($goods_category, true) . ";\r\n";
$content .= ' ?>';
file_put_contents(S_ROOT . 'source/data/goods_category' . $appid . '.php', $content);
?>